package com.hqyj.javaSpringBoot.modules.account.dao;

import com.hqyj.javaSpringBoot.modules.account.entity.RoleResource;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface RoleResourceDao {

    @Insert("insert into account_role_resource (resource_id,role_id) " +
            " values (#{resourceId},#{roleId})")
    @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
    void insertRoleResource(RoleResource roleResource);

    @Delete("delete  from account_role_resource where " +
            " role_id=#{roleId}")
    void deleteRoleResourceByRoleId(int roleId);

    @Delete("delete  from account_role_resource where " +
            " resource_id=#{resourceId}")
    void deleteRoleResourceByResourceId(int resourceId);
}
